﻿using System;

namespace LambdaExpressions
{
    class Program
    {
        delegate int MyDelegate(int x);
        static void Main(string[] args)
        {
            MyDelegate del1 = Double;
            MyDelegate del2 = new MyDelegate(Double);
            MyDelegate del3 = delegate(int x)
            {
                return 2 * x;
            };
            MyDelegate del4 = (x) => { return 2 * x; };
            MyDelegate del5 = x => 2 * x;
        }

        static int Double(int x)
        {
            return 2 * x;
        }
    }
}
